var app = getApp();
Page({
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function() {

  },

    onShow: function() {
        var store_id = wx.getStorageSync("store_id");
        this.setData({
            store_id:store_id
        })
        this.getDiyList();
    },

    getDiyList:function(){
        var t = this;
        app.visit("huodong/getDiyList", {
            store_id:t.data.store_id
        }, "", function(c) {
            console.log(c)
            if(0 == c.code){
                t.setData({
                    info:c.data
                })
            }else{
                app.showToast(c.msg)
            }
        })
    },

  diy_edit: function (e) {
    wx.navigateTo({
      url: 'diy_edit'
    });
  },
  diy_add: function (e) {
      var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: 'diy_add?id='+id
    });
  },
})